﻿<phone:PhoneApplicationPage 
    x:Class="PhoneApp1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<Storyboard x:Name="swingStoryboard" RepeatBehavior="Forever">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="armCanvas">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="30"/>
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-30"/>
				<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="stopStoryboard">
			<DoubleAnimation x:Name="stopAnimation" Duration="0:0:.2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="armCanvas" d:IsOptimized="True"/>
		</Storyboard>
	</phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Canvas>
    	<Image Height="728" Source="Images/metronome.png" Stretch="Fill" Width="480" VerticalAlignment="Top"/>
    	<Canvas Height="564" Width="480" Canvas.Top="81" RenderTransformOrigin="0.5,1">
    		<Canvas.Clip>
    			<RectangleGeometry Rect="0.5,0.5,479,563"/>
    		</Canvas.Clip>
    		<Canvas x:Name="armCanvas" Height="498" Canvas.Left="206" Canvas.Top="72" Width="68" RenderTransformOrigin="0.5,1">
    			<Canvas.RenderTransform>
    				<CompositeTransform/>
    			</Canvas.RenderTransform>
    			<Image Height="498" Source="Images/arm.png" Stretch="Fill" Width="12" Canvas.Left="27"/>
    			<Image Height="84" Source="Images/weight.png" Stretch="Fill" Canvas.Top="144" Width="68"/>
    		</Canvas>
    	</Canvas>
    </Canvas>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/icons/appbar.transport.play.rest.png" Text="Button 1"
                                            x:Name="playButton"
                                            Click="playButton_Click" />
            <shell:ApplicationBarIconButton IconUri="/icons/appbar.stop.rest.png" Text="Button 2"
                                            x:Name="stopButton"
                                            Click="stopButton_Click" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
